import request from '@/utils/request'

// 获取分销设置课程分销是否开启信息
export function getCourseDistributionStatus(params) {
  return request({
    url: '/ops/distributionCourseSetting/getCourseSetting',
    method: 'get',
    params: { tenantId: params }
  })
}

// 修改分销设置课程分销是否开启信息
export function updataCourseDistributionStatus(data) {
  return request({
    url: '/ops/distributionCourseSetting/addOrUpdateCourseSetting',
    method: 'post',
    data
  })
}

// 获取活动中的课程列表信息
export function getCourseInActivity(params) {
  return request({
    url: '/ops/distributionCourseSetting/getCourseInActivityList',
    method: 'get',
    params: { tenantId: params }
  })
}

// 获取分销设置课程分销活动列表信息
export function getCourseNotInActivity(courseIds) {
  return request({
    url: '/ops/distributionCourseSetting/getCourseNotInActivity',
    method: 'get',
    params: { courseIds: courseIds }
  })
}

// 添加活动中的课程信息
export function addCourseInActivity(data) {
  return request({
    url: '/ops/distributionCourseSetting/addCourseActivity',
    method: 'post',
    data
  })
}

// 根据id修改活动中的课程列表代理商分成比例信息
export function updateCourseInActivity(data) {
  return request({
    url: '/ops/distributionCourseSetting/updateCourseActivity',
    method: 'post',
    data
  })
}

// 活动中的课程退出
export function deleteCourseInActivityById(id) {
  return request({
    url: '/ops/distributionCourseSetting/delCourse',
    method: 'get',
    params: { id: id }
  })
}
